from .global_pipe import *
from .log import Logger, LogLevel
import os
import sys


# 当前操作系统名称
OS_NAME: str = sys.platform
# 项目根目录
PROJECT_ROOT_DIR: str = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/").replace("/boot", "")
# 本地数据库根目录
DB_ROOT_DIR: str = PROJECT_ROOT_DIR + "/data"
# 项目配置文件目录
CONFIG_ROOT_DIR: str = PROJECT_ROOT_DIR + "/config"
# 图片文件目录
IMG_ROOT_DIR: str = PROJECT_ROOT_DIR + "/img"
# 字体文件目录
FONT_ROOT_DIR: str = PROJECT_ROOT_DIR + "/font"
# PDF生成目录
PDF_ROOT_DIR: str = PROJECT_ROOT_DIR + "/pdf"
# 项目日志系统
logger = Logger()

# 打包状态
if hasattr(sys, '_MEIPASS'):
    IS_BIN: bool = True
else:
    IS_BIN: bool = False
logger.debug(f"当前打包状态：{IS_BIN}")

# 配置文件读写函数
from .config_file_utils import get_json_config, set_json_config